<?php

declare(strict_types=1);

namespace app\api\controller;

use think\facade\Request;
use wechat\sign\JSSDK;

require_once '../extend/wechatSign/jssdk.php';


class WechatScript
{
    // 服务端签名
    public function getSignPackage()
    {
        $url = Request::param('url');
        $jssdk = new JSSDK("公众号AppID", "公众号密钥");
        $signPackage = $jssdk->GetSignPackage(urldecode($url));
        return jsonData(1, '签名成功', $signPackage);
    }
}
